package com.mrjy.integral.dao;

import java.util.List;

import com.mrjy.common.entity.IntegralExchangedLog;
import com.mrjy.integral.dto.IntegralExchangeDTO;
import com.mrjy.integral.dto.IntegralExchangedLogDTO;
import com.mrjy.integral.dto.IntegralExchangedOrderDTO;

public interface IIntegralExchangedLogDao {

	int countByUserId(IntegralExchangedLogDTO dto);

	List<IntegralExchangeDTO> queryByUserId(IntegralExchangedLogDTO dto);

	IntegralExchangedLogDTO queryIEDetailById(IntegralExchangedLog exchangedLog);

	int insert(IntegralExchangedLog log);

	int queryCountForBack(IntegralExchangedLogDTO dto);

	List<IntegralExchangedLogDTO> queryPageForBack(IntegralExchangedLogDTO dto);

	int updateDisableFlag(IntegralExchangedLog exchangedLog);

	int updateById(IntegralExchangedLog exchangedLog);

	List<IntegralExchangedOrderDTO> queryPageUsedForBack(
			IntegralExchangedLogDTO dto);

	int queryCountUsedForBack(IntegralExchangedLogDTO dto);
	
	/**
	 * 检查该代金券是否可用
	 * @param voucherId
	 * @return
	 */
	IntegralExchangedLog isAvailable(Integer voucherId);

	IntegralExchangedLog queryById(Integer voucherId);
	
	int canBeDisabled(Integer integralExchangeId);
	
	IntegralExchangedLog queryByUserIdAndIEId(IntegralExchangedLog exchangedLog);
}
